use rpc::dto::{RpcPing, RpcPong };
use rpc::{RpcContext, RpcChannel, RpcResult};
use async_trait::async_trait;
use rpc_derive::{rpc_router, rpc_service};

#[rpc_router]
pub fn pong(_context: &mut RpcContext, _ping: RpcPing) -> RpcPong {
    RpcPong
}

#[rpc_service]
#[async_trait]
pub trait PingService {

    #[path="ping"]
    async fn ping(&mut self, channel: &mut impl RpcChannel, ping: RpcPing) -> RpcResult<RpcPong>;
}